/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MPCCad.java
 *
 * Created on 03.03.2010, 20:30:38
 */
package GUI;

import Common.*;
import Project.MPCProject;

/**
 *
 * @author Администратор
 */
public class MPCCad extends javax.swing.JFrame {

    IPlatform platform;

    /** Creates new form MPCCad */
    public MPCCad() {
        initComponents();
        Initialize();
    }

    private void Initialize() {
        platform = MPCProject.Instance().Initialize();
        projectModelView1.setProjectModel(platform.getProjectModel());
        //addMouseListener(IPrimitiveCollection);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jToolBar_Components = new javax.swing.JToolBar();
        jToggleButton_Line = new javax.swing.JToggleButton();
        jToggleButton_Rectangle = new javax.swing.JToggleButton();
        projectModelView1 = new UI.ProjectModelView();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                formMouseClicked(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                formMousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                formMouseReleased(evt);
            }
        });

        jToolBar_Components.setOrientation(1);
        jToolBar_Components.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jToggleButton_Line.setText("Линия");
        jToggleButton_Line.setFocusable(false);
        jToggleButton_Line.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jToggleButton_Line.setPreferredSize(new java.awt.Dimension(93, 25));
        jToggleButton_Line.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar_Components.add(jToggleButton_Line);

        jToggleButton_Rectangle.setText("Прямоугольгник");
        jToggleButton_Rectangle.setFocusable(false);
        jToggleButton_Rectangle.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jToggleButton_Rectangle.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToggleButton_Rectangle.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jToggleButton_RectangleActionPerformed(evt);
            }
        });
        jToolBar_Components.add(jToggleButton_Rectangle);

        getContentPane().add(jToolBar_Components, java.awt.BorderLayout.LINE_END);
        getContentPane().add(projectModelView1, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jToggleButton_RectangleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton_RectangleActionPerformed
      
    }//GEN-LAST:event_jToggleButton_RectangleActionPerformed

    private void formMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseClicked
    }//GEN-LAST:event_formMouseClicked

    private void formMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMousePressed
        
    }//GEN-LAST:event_formMousePressed

    private void formMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseReleased
       
    }//GEN-LAST:event_formMouseReleased

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new MPCCad().setVisible(true);

            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JToggleButton jToggleButton_Line;
    private javax.swing.JToggleButton jToggleButton_Rectangle;
    private javax.swing.JToolBar jToolBar_Components;
    private UI.ProjectModelView projectModelView1;
    // End of variables declaration//GEN-END:variables
}
